//
//  Extension+Label.swift
//  eBooks
//
//  Created by JunMing on 2019/12/3.
//  Copyright © 2019 赵俊明. All rights reserved.
//

import UIKit
extension UILabel {
    func configLabel(textAlig:NSTextAlignment = NSTextAlignment.left,font:UIFont?,tColor:UIColor = UIColor.gray) {
        self.numberOfLines = 0
        self.textColor = tColor
        self.font = font
        self.textAlignment = textAlig
    }
}

extension UIImage {
    public var origin:UIImage {
        return self.withRenderingMode(UIImage.RenderingMode.alwaysOriginal)
    }
    
    public var resizable:UIImage {
        let w = size.width * 0.5
        let h = size.height * 0.5
        let edge = UIEdgeInsets(top: h, left: w, bottom: h, right: w)
        return resizableImage(withCapInsets: edge,resizingMode: .stretch)
    }
}
